package com.qf.joint.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.joint.pojo.Address;
import com.qf.joint.service.AddressService;
import com.qf.joint.utils.Info;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @Author Zhy
 * Date on 2020/9/13  11:41
 * @description 测试
 */
@Controller
@RequestMapping("/fore")

public class ForegroundSysController {
    @Autowired
    private AddressService addressService;

    //http://localhost:8080/fore/index
    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String loadIndex(){
        System.out.println("JobhunterController-loadIndex");
        return "foregroundSys1";//-/WEB-INF/view/foregroundSys1.jsp
    }

    //http://localhost:8080/fore/showAll
    @RequestMapping(value = "/showAll", method = RequestMethod.GET)
    public ModelAndView selectAll(ModelAndView mv) {
        List<Address> list = addressService.selectAll();
        System.out.println(list);
        mv.addObject("objLi", list);
        mv.setViewName("foregroundSys2");
        return mv;
    }
}
